#define LABEL_MAX	16
int err_code;		/* temporary storage for error number */
#include <minix/config.h>	/* MUST be first */
#include <ansi.h>		/* MUST be second */
#include <sys/types.h>
#include <minix/const.h>
#include <minix/type.h>
#include <minix/dmap.h>

#include <minix/ds.h>
#include <minix/rs.h>
#include "vnode.h"
#include <minix/vfsif.h>

#include <limits.h>
#include <errno.h>
#include "dmap.h"
#include "fproc.h"

struct vnode *eat_path(int , struct fproc*);

int customsocket(){
	/*/usr/src/servers/vfs/device.c dev_open*/
	  int major, r, proc;
	  struct dmap *dp;
	  struct vnode *vp;
	  struct fproc *fp;	/* pointer to caller's fproc struct */
	  dev_t dev;
	  proc = VFS_PROC_NR;
	  if ((vp = eat_path(PATH_NOFLAGS, fp)) == NULL) return(err_code);
	  dev = (dev_t) vp->v_sdev;

	  major = 7; /*Eth*/
	  if (major >= NR_DEVICES) major = 0;
	  dp = &dmap[major];
	  if (dp->dmap_driver == NONE) return(ENXIO);
	  r = (*dp->dmap_opcl)(DEV_OPEN, dev, proc, 0);
	  return 0;
}
